<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;
// 无需校验token
Route::group('/api', function () {
    Route::any('/index', [app\controller\IndexController::class,'index']);


    Route::any('/generate_explore_chapter', [app\controller\IndexController::class,'generate_explore_chapter']);//生成探索章节
    Route::any('/generate_explore_story', [app\controller\IndexController::class,'generate_explore_story']);//生成探索故事
    Route::any('/generate_explore_task', [app\controller\IndexController::class,'generate_explore_task']);//生成探索任务
    Route::any('/generate_explore_task_prop', [app\controller\IndexController::class,'generate_explore_task_prop']);//生成探索任务需要提交的道具
    Route::any('/generate_explore_story_dialogue', [app\controller\IndexController::class,'generate_explore_story_dialogue']);//生成探索故事完成后的对话
    Route::any('/generate_explore_navigation', [app\controller\IndexController::class,'generate_explore_navigation']);//生成探索导航


    Route::any('/init_game_config', [app\controller\IndexController::class,'init_game_config']);//初始化游戏配置
    Route::any('/tool_factory', [app\controller\IndexController::class,'tool_factory']);
    Route::any('/login', [app\controller\LoginController::class,'index']);

});


Route::group('/api', function () {
    //---------------------------用户------------------------------------//
    Route::group('/user',function (){
        Route::any('/index', [app\controller\UserController::class,'index']);//获取用户信息
        Route::any('/change_money', [app\controller\UserController::class,'change_money']);//用户资金变更
        Route::any('/websocket', [app\controller\UserController::class,'websocket']);//获取长连接
        Route::any('/get_position', [app\controller\UserController::class,'get_position']);//获取地块
        Route::any('/unlock_position', [app\controller\UserController::class,'unlock_position']);//解锁地块
    });

    //---------------------------钓鱼------------------------------------//
    Route::group('/user_fish',function (){
        Route::any('/guide', [app\controller\UserFishController::class,'guide']);//鱼谱图鉴
        Route::any('/list', [app\controller\UserFishController::class,'list']);//用户鱼列表
        Route::any('/throwing_rod', [app\controller\UserFishController::class,'throwing_rod']);//抛竿
    });

    //---------------------------图鉴------------------------------------//
    Route::group('/dex',function (){
        Route::any('/list', [app\controller\DexController::class,'list']);//图鉴列表
    });

    //---------------------------工厂------------------------------------//
    Route::group('/factory',function (){
        Route::any('/get_factory_status', [app\controller\UserFactoryController::class,'get_factory_status']);//获取工厂状态
        Route::any('/get_factory_queue_status', [app\controller\UserFactoryController::class,'get_factory_queue_status']);//获取工厂生产队列
        Route::any('/list', [app\controller\UserFactoryController::class,'list']);//建筑商店
        Route::any('/index', [app\controller\UserFactoryController::class,'index']);//详情
        Route::any('/buy', [app\controller\UserFactoryController::class,'buy']);//购买
        Route::any('/building', [app\controller\UserFactoryController::class,'building']);//建造
        Route::any('/upgrade', [app\controller\UserFactoryController::class,'upgrade']);//升级
        Route::any('/complete', [app\controller\UserFactoryController::class,'complete']);//建造/升级完成
        Route::any('/production', [app\controller\UserFactoryController::class,'production']);//生产工具
        Route::any('/pick', [app\controller\UserFactoryController::class,'pick']);//手动收取生产工具
        Route::any('/change_position', [app\controller\UserFactoryController::class,'change_position']);//更换位置
    });

    //---------------------------装饰建筑------------------------------------//
    Route::group('/ornament',function (){
        Route::any('/list', [app\controller\UserOrnamentsController::class,'list']);//列表
        Route::any('/buy', [app\controller\UserOrnamentsController::class,'buy']);//购买
        Route::any('/install', [app\controller\UserOrnamentsController::class,'install']);//安装
        Route::any('/uninstall', [app\controller\UserOrnamentsController::class,'uninstall']);//卸载
    });

    //---------------------------热门商店------------------------------------//
    Route::group('/hot_shop',function (){
        Route::any('/list', [app\controller\HotShopController::class,'list']);//获取热门商店信息
        Route::any('/buy', [app\controller\HotShopController::class,'buy']);//购买
    });

    //---------------------------至臻商店------------------------------------//
    Route::group('/high_shop',function (){
        Route::any('/list', [app\controller\HighShopController::class,'list']);//获取至臻店信息
        Route::any('/watch', [app\controller\HighShopController::class,'watch']);//观看
        Route::any('/reward', [app\controller\HighShopController::class,'reward']);//领取
    });


    //---------------------------角色商店------------------------------------//
    Route::group('/role_shop',function (){
        Route::any('/list', [app\controller\RoleShopController::class,'list']);//获取角色商店信息
        Route::any('/buy', [app\controller\RoleShopController::class,'buy']);//购买
    });

    //---------------------------钻石商店------------------------------------//
    Route::group('/diamond_shop',function (){
        Route::any('/list', [app\controller\DiamondShopController::class,'list']);//获取钻石商店信息
        Route::any('/buy', [app\controller\DiamondShopController::class,'buy']);//购买
    });

    //---------------------------限时商店------------------------------------//
    Route::group('/limited_time_shop',function (){
        Route::any('/list', [app\controller\DiamondShopController::class,'list']);//获取限时商店信息
        Route::any('/buy', [app\controller\DiamondShopController::class,'buy']);//购买
    });

    //---------------------------城堡------------------------------------//
    Route::group('/castle',function (){
        Route::any('/index', [app\controller\CastleLevelConfigController::class,'index']);//查询晋升下一等级的条件
        Route::any('/upgrade', [app\controller\CastleLevelConfigController::class,'upgrade']);//升级
    });


    //---------------------------星愿雕像------------------------------------//
    Route::group('/wish',function (){
        Route::any('/index', [app\controller\UserWishController::class,'index']);//获取
        Route::any('/refresh', [app\controller\UserWishController::class,'refresh']);//刷新
        Route::any('/complete', [app\controller\UserWishController::class,'complete']);//完成
    });



    //---------------------------气球旅行------------------------------------//
    Route::group('/travel',function (){
        Route::any('/index', [app\controller\UserTravelController::class,'index']);//获取
        Route::any('/start', [app\controller\UserTravelController::class,'start']);//出发
        Route::any('/complete', [app\controller\UserTravelController::class,'complete']);//完成旅行
    });



    //---------------------------宇宙列车------------------------------------//
    Route::group('/space_train',function (){
        Route::any('/index', [app\controller\UserSpaceTrainController::class,'index']);//获取
        Route::any('/start', [app\controller\UserSpaceTrainController::class,'start']);//出发
        Route::any('/complete', [app\controller\UserSpaceTrainController::class,'complete']);//完成
    });

    //---------------------------游戏好友------------------------------------//
    Route::group('/friend',function (){
        Route::any('/index', [app\controller\UserFriendController::class,'index']);//获取好友列表
        Route::any('/add', [app\controller\UserFriendController::class,'add']);//添加
        Route::any('/verify', [app\controller\UserFriendController::class,'verify']);//验证
    });


    //---------------------------扭蛋抽奖------------------------------------//
    Route::group('/luck',function (){
        Route::any('/index', [app\controller\UserLuckController::class,'index']);//详情
        Route::any('/pool', [app\controller\UserLuckController::class,'pool']);//扭蛋池
        Route::any('/draw', [app\controller\UserLuckController::class,'draw']);//抽奖
    });



    //---------------------------探索------------------------------------//
    Route::group('/explore',function (){
        Route::any('/get_explore_address_list', [app\controller\UserExplore::class,'get_explore_address_list']);//获取探索星球列表
        Route::any('/get_explore_chapter_list', [app\controller\UserExplore::class,'get_explore_chapter_list']);//获取探索章节列表
        Route::any('/get_explore_story_list', [app\controller\UserExplore::class,'get_explore_story_list']);//获取探索故事列表
        Route::any('/get_explore_task_list', [app\controller\UserExplore::class,'get_explore_task_list']);//获取探索任务列表
        Route::any('/get_explore_navigation', [app\controller\UserExplore::class,'get_explore_navigation']);//获取探索导航-收录任务
        Route::any('/get_user_explore_reward_list', [app\controller\UserExplore::class,'get_user_explore_reward_list']);//获取玩家探索奖励列表
        Route::any('/submit_tool', [app\controller\UserExplore::class,'submit_tool']);//提交工具
        Route::any('/receive_explore_reward', [app\controller\UserExplore::class,'receive_explore_reward']);//领取探索奖励
    });

    //---------------------------二级市场------------------------------------//
    Route::group('/market',function (){
        Route::any('/list', [app\controller\UserMarketController::class,'list']);//寄售列表
        Route::any('/sell', [app\controller\UserMarketController::class,'sell']);//寄售
        Route::any('/my_sell_list', [app\controller\UserMarketController::class,'my_sell_list']);//我的寄售
        Route::any('/add_sale', [app\controller\UserMarketController::class,'add_sale']);//添加寄售

    });



    //---------------------------基础配置------------------------------------//
    Route::group('/config',function (){
        Route::any('/factory_list', [app\controller\ConfigController::class,'factory_list']);//工厂列表
        Route::any('/factory_material_list', [app\controller\ConfigController::class,'factory_material_list']);//工厂工具列表
        Route::any('/factory_ingredients_list', [app\controller\ConfigController::class,'factory_ingredients_list']);//工厂生产材料列表
    });




})->middleware([\app\middleware\AuthCheck::class]);